package fate.xp3;


public class XP3Segment {
    private final boolean compressed;
    private final long offset;
    private final long original_size;
    private final long compressed_size;

    public boolean isCompressed() {
        return compressed;
    }

    public long getOffset() {
        return offset;
    }

    public long getOriginalSize() {
        return original_size;
    }

    public long getCompressedSize() {
        return compressed_size;
    }

    public XP3Segment(boolean compressed, long offset, long original_size, long compressed_size) {
        this.compressed = compressed;
        this.offset = offset;
        this.original_size = original_size;
        this.compressed_size = compressed_size;

        if ((!compressed) && (compressed_size != original_size)) {
            throw new RuntimeException("Original segment size != compressed segment size, but compressed flag is 0");
        }
    }
}
